home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / SOUND-1.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  474b  |  20 lines

  1. ' SOUND-1.BAS
  2. ' This program demonstrates the SOUND statement.
  3.  
  4. CLS
  5.  
  6. INPUT "Please enter an octave value (1-7):  ", octave%
  7.  
  8. ' play one octave
  9.  
  10. FOR i% = 1 TO 8
  11.     READ note%                           ' read frequency of note
  12.     note% = note% * (2 ^ octave%)        ' raise note to desired octave
  13.     SOUND note%, 12                      ' play note
  14. NEXT i%
  15.  
  16. ' frequencies of the major notes in the second octave
  17.  
  18. DATA 65, 73, 82, 87, 98, 110, 123, 131
  19.  
  20.